﻿
Partial Class contact
    Inherits System.Web.UI.Page
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()

        mailMessage.To.Add(New System.Net.Mail.MailAddress(txtTo.Text.Trim()))
        mailMessage.From = New System.Net.Mail.MailAddress(txtFrom.Text())
        mailMessage.Subject = txtSub.Text.Trim()
        mailMessage.Body = txtBody.Text.Trim()

        Dim smtpClient As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient()

        smtpClient.Send(mailMessage)

        txtFrom.Text = ""
        txtSub.Text = ""
        txtBody.Text = ""

    End Sub
End Class

